package net.worldscale.xp.wslib.urm;

import net.worldscale.xp.wslib.urm.io.Connector;
import net.worldscale.xp.wspr.Module;
import net.worldscale.xp.wspr.ModuleKey;
import net.worldscale.xp.wspr.WSPR;

public abstract class URM extends Module {

    public static final ModuleKey MODULE_KEY = new ModuleKey(URM.class.getName());
    private static URM sInst;

    public static URM getInstance() {
        URM i = sInst;
        if (i == null) {
            i = (URM) WSPR.getInstance().getModuleManager().createModule(
                    MODULE_KEY);
            sInst = i;
        }
        return sInst;
    }

    public abstract AppManager getAppManager();

    public abstract Connector getConnector();

    public abstract Connector getConnectorImpl();

    public abstract URI newURI(String uri) throws BadUriException;

    public abstract URI newURI(String scheme, String host, String port, String path, String query, String fragment) throws BadUriException;

    public abstract URI calcURI(String base, String offset) throws BadUriException;

    public abstract URI calcURI(URI base, URI offset) throws BadUriException;

    public abstract MimeType newMimeType(String mime);
}
